﻿#include "dxstdafx.h"
#include "TerrainIDInfo.h"
#include "Data/ScriptData/TerrainType/TerrainTypeInfo.h"

bool _stTerrainIDInfo::empty() const
{
	return nullptr == pTerrainTypeInfo || pTerrainTypeInfo->empty();
}

const _stTerrainIDInfo* CTerrainIDInfo::GetInfoCPtr(BYTE KeyIn) const
{
	auto result = m_mapTerrainIDInfo.find(KeyIn);
	if (m_mapTerrainIDInfo.end() == result)
	{
		return nullptr;
	}
	return &result->second;
}

bool CTerrainIDInfo::IsDataComplete() const
{
	for (const auto& it : m_mapTerrainIDInfo)
	{
		if (it.second.empty())
		{
			return false;
		}
	}
	return true;
}
